<template>
     <table class="my-table">
      <thead>
        <tr>
          <th>
            编号
            </th>

          <th><slot name="mingcheng">名称</slot></th>

          <th><slot name="tupian">图片</slot></th>

          <th width="100px"><slot name="biaoqian">标签</slot></th>

        </tr>

      </thead>

      <tbody>
        <tr v-for="(item,index) in data" :key="item.id">
          <td>{{ index+1 }}</td>

          <td>{{ item.name }}</td>

          <td>
            <img :src="item.picture" />
          </td>

          <td>
            <div class="my-tag">
              <MyTag :tag.sync="item.tag"></MyTag>
            </div>

          </td>

        </tr>

      </tbody>

    </table>

</template>

<script>
import MyTag from './components/MyTag.vue';

export default {
    components:{
        MyTag
    },
    props:{
        data:Array
    }
}
</script>

<style lang="less" scoped>
 .my-table {
    width: 100%;
    border-spacing: 0;
    img {
      width: 100px;
      height: 100px;
      object-fit: contain;
      vertical-align: middle;
    }
    th {
      background: #f5f5f5;
      border-bottom: 2px solid #069;
    }
    td {
      border-bottom: 1px dashed #ccc;
    }
    td,
    th {
      text-align: center;
      padding: 10px;
      transition: all 0.5s;
      &.red {
        color: red;
      }
    }
    .none {
      height: 100px;
      line-height: 100px;
      color: #999;
    }
  }
</style>